home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol025 / cannon.bas < prev    next >
Encoding:
BASIC Source File  |  1987-01-11  |  2.3 KB  |  70 lines

  1. 10 PRINT TAB(30);"CANNONEER"
  2. 20 PRINT:PRINT:PRINT
  3. 30 PRINT"You are the commander of a gun crew for a long-range"
  4. 40 PRINT"cannon. You must give your crew the proper angle "
  5. 50 PRINT"of elevation in degrees to put your rounds on the "
  6. 60 PRINT"target. A hit by one of your high explosive rounds "
  7. 70 PRINT"within a hundered meters of the target will destroy it. "
  8. 80 PRINT
  9. 90  SEC = 18.2 'clock ticks to make 1 second used for sound stmt
  10. 100 R=INT(4000*RND(6)+10000)
  11. 110 PRINT"The maximum range of your gun is ";R;" meters."
  12. 120 Z=0
  13. 130 PRINT
  14. 140 S1=0
  15. 150 T=INT(R*(.1+.8*RND(6)))
  16. 160 S=0
  17. 170 GOTO 380
  18. 180 PRINT"Barrel cannot be depressed below one degree."
  19. 190 GOTO 410
  20. 200 PRINT"Barrel elevation cannot exceed 89 degrees."
  21. 210 GOTO 410
  22. 220 PRINT"Forward observer reports round was long by ";ABS(E);" meters."
  23. 230 GOTO 410
  24. 240 PRINT"Forward observer reports round was short by ";ABS(E);" meters."
  25. 250 GOTO 410
  26. 260 PRINT"### TARGET DESTROYED###     ";S;" rounds fired."
  27. 270 S1=S1+S
  28. 280 IF Z=4 THEN 590
  29. 290 Z=Z+1
  30. 300 PRINT
  31. 310 FOR J = 1 TO 5
  32. 320 FOR FREQ = 500 TO 3500 STEP 100
  33. 330 SOUND FREQ,.35
  34. 340 NEXT FREQ
  35. 350 NEXT J
  36. 360 PRINT"Forward observer has sighted new activity!!!"
  37. 370 GOTO 150
  38. 380 PRINT"      Range to target is ";T;" meters."
  39. 390 PRINT"      Fire for effect!"
  40. 400 PRINT:PRINT
  41. 410 INPUT "Elevation? ",B
  42. 420 IF B>89 THEN 200
  43. 430 IF B<1 THEN 180
  44. 440 SOUND 400,.5*SEC
  45. 450 FOR FREQ = 3000 TO 4000 STEP 10
  46. 460  SOUND FREQ, .02*SEC
  47. 470 NEXT FREQ
  48. 480 SOUND 150,.5*SEC
  49. 490 S=S+1
  50. 500 IF S<6 THEN 550
  51. 510 PRINT
  52. 520 SOUND 100,10
  53. 530 PRINT"BOOM!!!  You have just been destroyed by enemy fire."
  54. 540 PRINT:PRINT:PRINT: GOTO 630
  55. 550 B2=2*B/57.3 : I = R*SIN(B2) : X=T-I : E=INT(X)
  56. 560 IF ABS(E)<100 THEN 260 'target destroyed
  57. 570 IF E>100 THEN 240 'round short
  58. 580 GOTO 220 'over target
  59. 590 PRINT:PRINT:PRINT"Total rounds expended: ";S1
  60. 600 IF S1>18 THEN 630
  61. 610 PRINT "Nice shooting! There could be a promotion in ths for you."
  62. 620 GOTO 650
  63. 630 PRINT "The cook can do better! Did you sleep through artillery"
  64. 640 PRINT "school? You need a refresher at Fort Sill."
  65. 650 PRINT: INPUT "Another target? (Y or N)";Z$
  66. 660 IF Z$="Y" OR Z$= "y" THEN 100
  67. 670 PRINT "You deserve some R&R. See you later."
  68. 680 END
  69. T "Another target? (Y or N)";Z$
  70. 660